package main

import "fmt"
import "reflect"

func reflectFn(x interface{}) {
	t := reflect.TypeOf(x)
	name := t.Name()
	kind := t.Kind()
	fmt.Printf("类型：%v，类型名称：%v，类型种类：%v\n", t, name, kind)
}

type Person struct {
	Name string 
	Age  int
}

func main() {
	a := 10
	reflectFn(a)
	b := 3.14
	reflectFn(b)
	c := "hello world"
	reflectFn(c)
	d := true
	reflectFn(d)
	e := []int{1, 2, 3, 4, 5}
	reflectFn(e)
	p := Person{
		Name: "张三",
		Age:  18,
	}
	reflectFn(p)
	p_ptr := &p
	// 指针的类型名称是空
	reflectFn(p_ptr)
}